package com.zhao.data.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import com.zhao.data.model.City;

public interface CityMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(City record);

	int insertSelective(City record);

	City selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(City record);

	int updateByPrimaryKey(City record);

	//	@Cacheable(value = "cityCache", key = "#root.targetClass + #root.methodName")
	@Select("select * from t_city")
	public List<City> selectAll();

	@Select("SELECT * FROM t_city where province_code in (SELECT province_code FROM t_province where province_name like CONCAT('%',#{provinceName},'%'))")
	public List<City> selectByProvinceName(String provinceName);

	@Select("SELECT * FROM t_city where city_name like CONCAT('%',#{cityName},'%')")
	public List<City> selectByCityName(String cityName);
}